package com.atstudy.thread;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/22 15:28
 * @copyright: 博为峰
 */
public class ThreadDemo05 {
    public static void main(String[] args) throws ExecutionException, InterruptedException, TimeoutException {
        Thread05 thread05 = new Thread05();
        FutureTask futureTask = new FutureTask(thread05);
        futureTask.run();
//        System.out.println(futureTask.get());
        futureTask.get(3, TimeUnit.MILLISECONDS);
    }
}
